<template>
  <div class="caption" :class="{ margin: margin }">
    <span class="text">{{ title }}</span>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'thy-caption',
  props: {
    title: {
      type: String,
      default: '标题'
    },
    margin: {
      type: Boolean,
      default: false
    }
  }
};
</script>

<style lang="less" scoped>
.caption {
  font-size: 16px;
  margin-top: 5px;
  line-height: 28px;
  &.margin {
    margin-bottom: 15px;
  }
  .text {
    border-left: 5px solid #409eff;
    padding-left: 10px;
    margin-right: 8px;
    line-height: 28px;
  }
}
</style>
